<?php require_once('header.php'); ?>
	<h1>Dashboard</h1>
    <div class = "top_menu">
        <h2>Quick Actions</h2>
        <ul class="hoverable">
            <li><a href="<?php print(APP_DIR_LINKS);?>/admin/content/create">Create Content</a></li>
            <li><a href="#">Manage Content</a></li>
            <li><a href="#">Create Users</a></li>
            <li><a href="#">Manage Users</a></li>
            <li><a href="#">Create Tags</a></li>
            <li><a href="#">Manage Tags</a></li>
        </ul>
	</div>
    
    <div class="top_menu" id = "recent">
        <h2>Recent Posts</h2>

        <table>
          <tr class = "recent_posts">
            <th id = "title" scope="col">Title</th>
            <th id = "author" scope="col">Author</th>
            <th id = "description" scope="col">Description</th>
            <th id = "tags" scope="col">Tags</th>
            <th id = "date" scope="col">Date</th>
          </tr>
		<?php 
			$posts = $this->getContentList(5);
        	foreach ($posts as $post) { ?>
		<tr>
		    <td><a class="recent_links" href=""><?php echo $post->getTitle(); ?></a></td>
		    <td><?php echo $post->getAuthor()->getUsername(); ?></td>
		    <td><?php echo $post->getDescription(); ?></td>
		    <td><?php echo $post->getTagsAsString(); ?></td>
		    <td><?php echo $post->getDate()->format('Y-m-d'); ?></td>
		</tr>
		<?php } // end foreach ?>
        </table>
    </div>
<?php require_once('footer.php'); ?>